* * Local Port and Limited Server Enhancements * * TPNS Version 3 Release 5 Service Level 9711 * APARs PQ14597, PQ14602, PQ16617, PQ16840 recommended * * Updated 6/12/98, to change offsets in ITPDSP to * avoid overlaying areas used when * running SNA simulations. * * This zap provides two enhancements to the TPNS TCP/IP * simulation support. * * The first enhancement allows the specification of the * local port number to be used by a Simple TCP (STCP) or * Simple UDP (SUDP) device instead of having that port * automatically assigned by TCP/IP. After the socket * has been obtained, TPNS will BIND that socket to the * specified local port. * * The second enhancement builds on the first and provides * a limited server simulation function. After BINDing * to the specified local port, TPNS can accept a connection * (STCP) or wait to receive data (SUDP). For STCP, only * one connection at a time can be processed, and TPNS closes * the listen socket between connections. For SUDP, an exit * (see below) is provided to glean the address associated * with the sender of an incoming message and to set the * address of the recipient for an outgoing message. * * To specify the local port to be used by a particular * simulated client or server, code the following two operands * on the DEV statement for that resource: * * TRANS=YES indicating that a specific * Local Port is to be used; * BLKDLY=Fxxxxx where xxxxx is the decimal * value of the local port to * be used; the F must be * included as shown. * * To specify that a particular DEV is to act as a limited * server, code the following operand on the DEV statement * for that resource: * * RTR=YES indicating that the DEV should * wait for an incoming connection * before generating any message. * * Note1: RTR=YES should not be coded unless TRANS=YES and * BLKDLY=Fn are also coded. This is not enforced but * unpredictable results will be obtained if the * restriction is not observed. * * Note2: All these operands MUST be coded ON THE DEV statement * to be effective. They will not default from higher * levels, even though in other circumstances the same * operands would so default. * * Note3: Clearly these operands are not normally valid on a * DEV following a TCPIP statement. Ignore their normal * meanings when using them on such a DEV. If this * enhancement is later supplied in other than zap * form, new operands will very likely be introduced * in lieu of these. * * Note4: For a DEV with TYPE=STCP and RTR=YES, the SERVADDR * and PORT operands, while they must have valid values, * are not used. For a DEV with TYPE=UDP and RTR=YES, * the SERVADDR and PORT are used as the destination * of all datagrams transmitted by the server. They * can be modified dynamically by the script for * particular messages using the ITPGSIPA exit described * below. * * * Associated Available User Exits * * In addition to this zap, two TPNS User Exits are available * that may be useful. These are available in separate files * and should be installed in accordance with directions in * the TPNS User Exits publication (SC31-6071). * * The ITPGSIPA exit can particularly helpful in a UDP server * environment. When specified as an input exit (INEXIT=ITPGSIPA * on the NTWRK statement) it will cause the full INET address * (including IP and port addresses) of the sender of each * message received by an STCP or SUDP device to be placed in * network save area 13. This address can be saved using an STL * ONIN scripting statement or an IF statement with WHEN=IN in * the TPNS Scripting Language. * * The same exit can also be specified in an STL script as * USEREXIT('ITPGSIPA') or in a TPNS Scripting Language script * as EXIT NAME=ITPGSIPA to cause the contents of network save * area 13 to be set as the address for the next message to be * transmitted by the UDP device (or the next connection to be * made by an STCP client). * * In addition, an information exit, ITPWR47X, is available to * write ITP477I and ITP478I informational messages, which are * the messaes logged when TCP/IP indicates any type of socket * call error, to the operator as well as to the TPNS log. * Use of this exit would be specified by coding * INFOEXIT=ITPWR47X on the NTWRK statement. * * Further information about these exits is available in the * separate jobs provided to install them. * * * The Local Port and Limited Server Enhancement Zap * * This zap applies to TPNS Version 3 Release 5 * Sevice Level 9711 * * APARs PQ14597, PQ14602, PQ16617, PQ16840 recommended * * NAME ITPINITI ITPOPTBL * Set bits in table to allow TRANS and BLKDLY to be * specified on TCPIP DEV. VER 0085 00 VER 032E 00 VER 0478 00 REP 0085 40 Allow RTR= on TCP/IP DEV REP 032E 40 Allow TRANS= on TCP/IP DEV REP 0478 40 Allow BLKDLY= on TCP/IP DEV * NAME ITPINITI ITPTLDEV VER 000F F9F74BF2F1F7 97.217 * Insure that defaults for RTR, BLKDLY, and TRANS are reset. VER 00D4 50405558 VER 07E0 C7E0C7E2 REP 00D4 47F0C7E0 B Patch Area REP 07E0 50405558 Repeat Overlaid Instruction REP 07E4 94F7400E NI DEFRTR REP 07E8 94B74008 NI DEFTRANS+DEFIBAVG REP 07EC 96804008 OI DEFIBFIX REP 07F0 D70340244024 XC DEFIBDLY REP 07F6 47F0C0D8 Return to Normal Processing * Allocate a second socket for STCP limited server. VER 0310 47F0C348 REP 0310 47F0C7FA B Patch Area REP 07FA 9108217E TM DEVRTR Limited Server REP 07FE 4780C348 Return to Normal Processing REP 0802 50A03054 ST TLUFLISN Set Listen Socket REP 0806 41A0A001 LA 10,1(,10) Add 1 to Socket Number REP 080A 50A03000 ST TLUSOCKT REP 080E 50A03058 ST TLUFDATA REP 0812 47F0C348 Return to Normal Processing * Test to see if STCP listen socket causes advance to new word * of mask. VER 075E 4780C79E VER 0762 58803054 VER 0772 58A03058 REP 075E 4780C816 Go to Patch Area if not FTP REP 0762 58803058 Reverse checks of REP 0772 58A03054 TLUFLISN and TLUFDATA REP 0816 91803079 TM TLUSTFL STCP REP 081A 4780C79E Return to Normal if not REP 081E 9108417E TM DEVRTR REP 0822 4710C772 BO Check Listen Socket REP 0826 47F0C79E B Return to Normal * NAME ITPENTER ITPTLSCH VER 000F F9F74BF2F9F4 97.294 * At end of SOCKET socket call, test for need to issue BIND. VER 0432 91406079 VER 0450 47F0CC62 VER 11E0 B1E1B1E3 REP 0432 47F0B1E1 B Patch Area REP 0450 47F0C4AC B to do CHEKSLCT REP 11E0 91085178 TM DEVTRANS Use Local Port? REP 11E4 4710B1F1 BO 11FO Yes if TRANS=YES. REP 11E8 91406079 Repeat Overlaid Instruction REP 11EC 47F0C436 Resume Normal Path REP 11F0 92026006 MVI TLUSTATE,X'02' BIND Pending REP 11F4 47F0C442 Return to build BIND * At end of SETSOCKOPT socket call, check for setting SO_REUSE * and go back to BIND Pending if so. VER 0502 4780C518 REP 0502 4780B211 BZ Patch Area REP 1210 91806005 TM TLUSNDOK SO_REUSE just set REP 1214 4780C518 Return to normal if not REP 1218 47F0B1F1 Go set BIND Pending again * At end of BIND socket call, process like end of SOCKET * for STCP or SUDP. VER 052E 91406039 REP 052E 47F0B1F9 B Patch Area REP 11F8 91086005 TM TLUFTPFL FTP? REP 11FC 4780B209 BZ 1208 No, set SOCKET state REP 1200 91406039 Repeat Overlaid Instruction REP 1204 47F0C532 Resume Normal Path REP 1208 92036006 MVI TLUSTATE,TLUSOCK Socket Complete REP 120C 47F0B1E9 Finish like SOCKET * At completion of LISTEN socket for STCP, set listening * state and proceed to ITPSTSND. VER 05AC 586051E4 REP 05AC 47F0B243 REP 1242 586051E4 REP 1246 91086005 TM TLUFTPFL REP 124A 4710C5B0 BO Return REP 124E 92086006 MVI TLUSTATE,TLULISNG REP 1252 47F0C49E Call ITPSTSND and Check for SELECT needed * At completion of ACCEPT socket call, set Active. VER 0606 586051E4 REP 0606 47F0B21D REP 121C 586051E4 REP 1220 9108517E TM DEVRTR REP 1224 4780C60A BNO Return REP 1228 47F0C49A B Go set TLUSTATE Active * At completion of SELECT socket call, see if ACCEPT is neeeded. VER 0672 586051E4 REP 0672 47F0B257 REP 1256 586051E4 REP 125A 9108517E TM DEVRTR Possibly ACCEPT Needed REP 125E 4780C676 BZ Return to Normal REP 1262 91806079 TM TLUSTFL STCP REP 1266 47E0C676 BNO Return to Normal REP 126A 58A06054 L TLUFLISN REP 126E 59A0B3C5 C SOCKET REP 1272 4770C676 BNE Return to Normal REP 1276 92096006 MVI TLUSTATE,TLUCALNG REP 127A 5050B351 REP 127E 58F0B38D REP 1282 4110B351 REP 1286 05EF Call ITPSTSND REP 1288 47F0C6D4 Go decrement TCPRDYCT * NAME ITPENTER ITPSTSND VER 000F F9F74BF2F3F8 97.238 * Go to Reserved Area in ITPDSP and do processing for * limited server (DEVRTR) before active state. VER 0044 585021E4 REP 0044 47F04A00 Patch Area in ITPDSP * Process Bind Pending state. first setting SO_REUSENAME * option and then indicating BIND is to be built. VER 019A 47F0C2C6 Branch Table Entry for Bind Pending VER 0308 C308C30A REP 019A 47F0C308 B Patch Area BIND Pending REP 0308 583021E4 L DEVTLUAD REP 030C 91803005 TM TLUSNDOK Need to set SO_REUSE REP 0310 4710C31C BO 031C No, go build BIND REP 0314 96803005 OI TLUSNDOK Indicate SO_REUSE REP 0318 47F0C1BE B 01BE Set for SETSOCKOPT REP 031C 947F3005 NI TLUSNDOK Reset SO_REUSE Flag REP 0320 41600002 LA BINDCALL Build BIND Call REP 0324 47F0C1C2 B 01C2 Build TNT * Turn on TNTFLISN for STCP with DEVRTR and not yet active. VER 02E2 42603010 REP 02E2 47F04AB8 Patch Area in ITPDSP * NAME ITPENTER ITPDSP VER 0A60 40404040 * Extension of ITPSTSND * Test for limited server before reaching active state * and process accordingly. * REP 0A60 585021E4 REP 0A64 9108217E TM DEVRTR Limited Server REP 0A68 4780C048 Return if not REP 0A6C 95065006 CLI TLUSTATE,TLUACTIV REP 0A70 4780C048 Return if already Active REP 0A74 1F11 Branch REP 0A76 43105006 according REP 0A7A 89100002 to REP 0A7E 47F14A22 state * Branch Table REP 0A82 47F0C1AA TLUACTIV - Build SOCKET call REP 0A86 47F0C2C6 TLUSTRTG - Ignore REP 0A8A 47F0C308 TLUBPNDG - BIND Pending, like client REP 0A8E 47F0C1BE TLUSOCK - Do SETSOCKOPT for OOBINLINE REP 0A92 47F0C2C6 TLUNEGO - Ignore REP 0A96 47F04A4A TLUSOPT - Issue LISTEN REP 0A9A 47F0C2C6 TLUACTIV - Ignore here REP 0A9E 47F0C2C6 TLUCLSNG - Ignore here REP 0AA2 47F04A52 TLULISNG - Set Mask to await connect REP 0AA6 47F04A82 TLUCALNG - Connect Pending, issue ACCEPT * Options set, issue LISTEN REP 0AAA 4160000D LA LISNCALL REP 0AAE 47F0C1C2 * LISTEN completed, set mask to allow call REP 0AB2 58005054 Turn REP 0AB6 8C000005 on REP 0ABA 89000002 mask REP 0ABE 18E0 bit REP 0AC0 5EE030E8 for REP 0AC4 8810001B Listen REP 0AC8 41000001 Socket REP 0ACC 89001000 . REP 0AD0 BF1FE000 . REP 0AD4 1610 . REP 0AD6 BE1FE000 . REP 0ADA 92015006 REP 0ADE 47F0C2C6 * Connect Pending, Issue ACCEPT REP 0AE2 58005054 Turn REP 0AE6 8C000005 off REP 0AEA 89000002 mask REP 0AEE 18E0 bit REP 0AF0 5EE030E8 for REP 0AF4 8810001B Listen REP 0AF8 41000001 Socket REP 0AFC 89001000 . REP 0B00 1F11 . REP 0B02 0610 . REP 0B04 1701 . REP 0B06 BF1FE000 . REP 0B0A 1410 . REP 0B0C BE1FE000 . REP 0B10 41600001 LA ACPTCALL REP 0B14 47F0C1AE * Extension to BUILDTNT routine in ITPSTSND * Set TNTFLISN for STCP limited server while not yet active REP 0B18 42603010 REP 0B1C 58E021E4 L DEVTLUAD REP 0B20 9180E079 TM TLUSTFL STCP REP 0B24 4780C2E6 REP 0B28 9108217E TM DEVRTR REP 0B2C 4780C2E6 REP 0B30 9506E006 CLI TLUSTATE,TLUACTIV REP 0B34 4780C2E6 REP 0B38 96403011 OI TNTFLISN REP 0B3C 47F0C2E6 * NAME ITPENTER ITPTLEXC VER 000F F9F74BF2F9F0 97.290 * Finish BIND call for STCP or SUDP for Macro API VER 01B6 5820305C VER 0B7C CB7CCB7E REP 01B6 47F0CB7C B Patch Area REP 0B7C 91083005 TM TLUFTPFL FTP? REP 0B80 4780CB8C BZ 0B8C No, Simple TCP or UDP REP 0B84 5820305C Repeat Overlaid Instruction REP 0B88 47F0C1BA Resume Normal Processing REP 0B8C 58206014 L TNTDEVAD Get DEV Address REP 0B90 58202194 L DEVBDLY Get Local PORT to use REP 0B94 40206092 STH TNTPORT PORT for BIND REP 0B98 91406011 TM TNTFLISN Check for Listen REP 0B9C 4710CBA8 BO 0BA8 Listen Socket set REP 0BA0 58203000 L TLUSOCKT Get Regular Socket REP 0BA4 4020607A STH TNTMSCKT Use it for this BIND REP 0BA8 1F22 SLR Clear IP Address REP 0BAA 47F0C1BA Resume Normal Processing * Finish BIND call for STCP or SUDP for IUCV API VER 066C 5850305C REP 066C 47F0CBAE B Patch Area REP 0BAE 91083005 TM TLUFTPFL FTP? REP 0BB2 4780CBBE BZ 0BBE No, Simple TCP or UDP REP 0BB6 5850305C Repeat Overlaid Instruction REP 0BBA 47F0C670 Resume Normal Processing REP 0BBE 58506014 L TNTDEVAD Get DEV Address REP 0BC2 58505194 L DEVBDLY Get Local PORT to use REP 0BC6 40506092 STH TNTPORT PORT for BIND REP 0BCA 91406011 TM TNTFLISN Check for Listen REP 0BCE 4710CBDA BO 0BDA Listen Socket set REP 0BD2 58503000 L TLUSOCKT Get Regular Socket REP 0BD6 4050700A STH IPRSOCKT Use it for this BIND REP 0BDA 1F55 SLR Clear IP Address REP 0BDC 47F0C670 Resume Normal Processing * Set appropriate socket option for STCP or SUDP for Macro API VER 0498 4780C4A4 REP 0498 4780CBE0 BZ PatchArea Not FTP REP 0BE0 91C03079 TM TLUSTFL+TLUUDFL STCP or SUDP REP 0BE4 4780C4A4 BZ If not, return to normal processing REP 0BE8 91803005 TM TLUSNDOK SO_REUSE needed REP 0BEC 4780C4A4 BZ If not, return to normal processing REP 0BF0 47F0C49C B 049C Set SO_REUSE * Set appropriate socket option for STCP or SUDP for IUCV API VER 09A2 4780C9B2 REP 09A2 4780CBF4 BZ PatchArea Not FTP REP 0BF4 91C03079 TM TLUSTFL+TLUUDFL STCP or SUDP REP 0BF8 4780C9B2 BZ If not, return to normal processing REP 0BFC 91803005 TM TLUSNDOK SO_REUSE needed REP 0C00 4780C9B2 BZ If not, return to normal processing REP 0C04 47F0C9A6 B 09A6 Set SO_REUSE * NAME ITPENTER ITPTLSTP VER 000F F9F74BF0F6F3 97.063 * Insure FTP only processing only done for FTP. VER 0366 587051E4 VER 042E C42EC430 REP 0366 47F0C42E REP 042E 587051E4 REP 0432 91087005 TM TLUFTPFL REP 0436 4710C36A BO Return to Normal REP 043A 47F0C3C8 B Bypass FTP only processing * NAME ITPENTER ITPALTER VER 000F F9F74BF1F1F3 97.113 * Allow alter of Blkdly (B= Operand) for TCP/IP DEV VER 28A0 00 REP 28A0 01 * * End of Zap *